home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-09-16 | 3.8 KB | 158 lines | [TEXT/CCL2] |
-
- (in-package :traps) ;
- ; Created: Sunday, January 6, 1991 at 10:54 PM
- ; Power.p
- ; Pascal Interface to the Macintosh Libraries
- ;
- ; Copyright Apple Computer, Inc. 1989-1990
- ; All rights reserved
- ;
-
- ;;;;;;;;;;;;;
- ;
- ; Modification History
- ;
- ; 04/28/93 mwp Release
- ; 08/10/92 bill in _AOff & _Boff: "-#xNNN" -> "#x-NNN"
- ; ------------- 2.0
- ; 08/23/91 bill Remove some return specs in the call form
- ;
-
- ; $IFC UNDEFINED UsingIncludes
- ; $SETC UsingIncludes := 0
- ; $ENDC
-
- ; $IFC NOT UsingIncludes
-
- ; $ENDC
-
- ; $IFC UNDEFINED UsingPower
- ; $SETC UsingPower := 1
-
- ; $I+
- ; $SETC PowerIncludes := UsingIncludes
- ; $SETC UsingIncludes := 1
- ; $IFC UNDEFINED UsingTypes
-
- (require-interface 'TYPES) ; $I $$Shell(PInterfaces)Types.p
- ; $ENDC
- ; $SETC UsingIncludes := PowerIncludes
-
- ; Bit positions for ModemByte
- (defconstant $modemOnBit 0)
- (defconstant $ringWakeUpBit 2)
- (defconstant $modemInstalledBit 3)
- (defconstant $ringDetectBit 4)
- (defconstant $modemOnHookBit 5)
-
- ; masks for ModemByte
- (defconstant $modemOnMask #x1)
- (defconstant $ringWakeUpMask #x4)
- (defconstant $modemInstalledMask #x8)
- (defconstant $ringDetectMask #x10)
- (defconstant $modemOnHookMask #x20)
-
- ; bit positions for BatteryByte
- (defconstant $chargerConnBit 0)
- (defconstant $hiChargeBit 1)
- (defconstant $chargeOverFlowBit 2)
- (defconstant $batteryDeadBit 3)
- (defconstant $batteryLowBit 4)
- (defconstant $connChangedBit 5)
-
- ; masks for BatteryByte
- (defconstant $chargerConnMask #x1)
- (defconstant $hiChargeMask #x2)
- (defconstant $chargeOverFlowMask #x4)
- (defconstant $batteryDeadMask #x8)
- (defconstant $batteryLowMask #x10)
- (defconstant $connChangedMask #x20)
-
- ; commands to SleepQRec sleepQProc
- (defconstant $sleepRequest 1)
- (defconstant $sleepDemand 2)
- (defconstant $sleepWakeUp 3)
- (defconstant $sleepRevoke 4)
-
- ; SleepQRec.sleepQFlags
- (defconstant $noCalls 1)
- (defconstant $noRequest 2)
-
- (defconstant $slpQType 16)
- (defconstant $sleepQType 16)
-
- (def-mactype :modembyte (find-mactype :unsigned-byte))
- (def-mactype :batterybyte (find-mactype :unsigned-byte))
-
- (def-mactype :pmresultcode (find-mactype :signed-long))
-
- (def-mactype :sleepqrecptr (find-mactype :pointer))
- (defrecord SleepQRec
- (sleepQLink (:pointer :sleepqrec))
- (sleepQType :signed-integer) ; type = 16
- (sleepQProc :pointer) ; Pointer to sleep routine
- (sleepQFlags :signed-integer)
- )
-
- (deftrap _idleupdate nil
- (:d0 :signed-long)
- (:register-trap #xA285))
-
-
- (deftrap _getcpuspeed nil
- (:d0 :signed-long)
- (:register-trap #xA485 :d0 -1))
-
- (deftrap _enableidle nil
- (:d0 :signed-long)
- (:register-trap #xA485 :d0 0))
-
-
- (deftrap _disableidle nil
- nil
- (:register-trap #xA485 :d0 1))
-
- (deftrap _sleepqinstall ((qrecptr (:pointer :sleepqrec)))
- nil
- (:register-trap #xA28A :a0 qrecptr))
-
- (deftrap _sleepqremove ((qrecptr (:pointer :sleepqrec)))
- nil
- (:register-trap #xA48A :a0 qrecptr))
-
- (deftrap _aon nil
- nil
- (:register-trap #xA685 :d0 4))
-
- (deftrap _aonignoremodem nil
- nil
- (:register-trap #xA685 :d0 5))
-
- (deftrap _bon nil
- nil
- (:register-trap #xA685 :d0 0))
-
- (deftrap _aoff nil
- nil
- (:register-trap #xA685 :d0 #x-84))
-
- (deftrap _boff nil
- nil
- (:register-trap #xA685 :d0 #x-80))
-
- ; $ENDC ; UsingPower
-
- ; $IFC NOT UsingIncludes
-
- ; $ENDC
-
-
- (export '($sleepqtype $slpqtype $norequest $nocalls $sleeprevoke $sleepwakeup
- $sleepdemand $sleeprequest $connchangedmask $batterylowmask
- $batterydeadmask $chargeoverflowmask $hichargemask $chargerconnmask
- $connchangedbit $batterylowbit $batterydeadbit $chargeoverflowbit
- $hichargebit $chargerconnbit $modemonhookmask $ringdetectmask
- $modeminstalledmask $ringwakeupmask $modemonmask $modemonhookbit
- $ringdetectbit $modeminstalledbit $ringwakeupbit $modemonbit))
- (provide-interface 'Power)
-